package mylab.io.core.event;

import io.netty.channel.ChannelHandlerContext;
import lombok.Getter;
import lombok.ToString;
import mylab.base.foundation.event.BaseEvent;

@ToString
public class ChannelExceptionEvent extends BaseEvent<ChannelHandlerContext, ChannelExceptionEvent.ChannelException> {
    public ChannelExceptionEvent(ChannelHandlerContext source, ChannelException content) {
        super(source, content);
    }

    @Getter
    public static class ChannelException {
        boolean isInbound;
        Throwable throwable;

        public ChannelException(boolean isInbound, Throwable throwable) {
            this.isInbound = isInbound;
            this.throwable = throwable;
        }
    }
}
